package com.hsd.znsh.repository;

import com.hsd.znsh.entity.Function;
import com.hsd.znsh.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-05-07 18:18:17
 */
public interface FunctionRepository extends JpaRepository<Function,Integer> {

    List<Function> findByIdInOrderByBhAsc(List<Integer> ids);

    @Query("select id from Function where url is not null and url <> '' and id in (?1)")
    List<Integer> findByIdListAndUrlIsNotNull(List<Integer> ids);

}
